"""
把会员的数据备份到另一个文件
"""

copy_f = open('E:/PythonBasicKnowledge/07 文件操作/备份数据.txt', 'w', encoding='UTF-8')

with open('E:/PythonBasicKnowledge/07 文件操作/原始数据.txt', 'r', encoding='UTF-8') as f:
    count = 0
    for line in f:
        if line.find('会员') != -1:
            copy_f.write(F'{line}')
            count += 1
    f.close()
    copy_f.close()
    print(F'✌备份完成，共备份了{count}条数据')
